import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:龙宝
 * Date:2023-11-16
 * Time:9:25
 */
class MyCallable implements Callable<String> {
    @Override
    public String call() throws Exception {
        System.out.println("线程call");
        return new String("线程");
    }
}
public class Thread6 {
    public static void main(String[] args) {
        MyCallable callable = new MyCallable();
        FutureTask<String> futureTask = new FutureTask<>(callable);
        Thread t =new Thread(futureTask);
        t.start();
        System.out.println("主线程");


        mmm m = new mmm();
        FutureTask<Integer> fff = new FutureTask<>(m);
        Thread ttt = new Thread(fff);
        ttt.start();
    }
}
class mmm implements Callable<Integer> {

    @Override
    public Integer call() throws Exception {
        System.out.println("jjja");
        return new Integer(1);
    }
}

